package com.springmvc.utils.method;

import com.springmvc.utils.majiang.ChannelUtil;

import io.netty.channel.Channel;
import io.netty.handler.codec.http.websocketx.TextWebSocketFrame;

public class ToUserUtil {

	/**
	 * 发送指定用户消息
	 * @Title: tousermsg 
	 * @param userid
	 * @param msg
	 * @return void    返回类型 
	 * @throws
	 */
	public static void tousermsg(Long userid, String msg) {
		Channel c = ChannelUtil.getChannel(userid);
		c.writeAndFlush(new TextWebSocketFrame(c.remoteAddress() + ": " + msg + "\n"));
	}

}
